/*********************************************************************
 * Interface for a binary search tree for which nodes
 * have 0,1,2 children.
 *
 * @author Duncan Buell, after GT chapter 7, page 271
**/
public interface IBST
{

/*********************************************************************
 * Accessors and mutators.
**/
/*********************************************************************
 * Returns the root.
 *
 * @return the root node.
**/
  public BTNode getRoot();

/*********************************************************************
 * Sets the root.
 *
 * @param the root node.
**/
  public void setRoot(BTNode v);

/*********************************************************************
 * Method to return the size of the tree.
 *
 * @return the <code>int</code> size (number of elements) of the tree.
**/
  public int getSize();

/*********************************************************************
 * Method to set the size of the tree.
 *
 * @param the <code>int</code> size to be set
**/
  public void setSize(int what);

/*********************************************************************
 * General methods.
**/
/*********************************************************************
 * Method to add the root of the BST
 *
 * @return the root added to the tree
**/
  public BTNode addRoot(BTNode v);

/*********************************************************************
 * Method to test to see if a <code>String</code> is in the tree
 *
 * @return the <code>boolean</code> answer.
**/
  public boolean contains(String testString);

/*********************************************************************
 * Method to create a node
 *
 * @return the node created
**/
  public BTNode createNode(Record rec, BTNode parent,
                           BTNode left, BTNode right);

/*********************************************************************
 * Method to insert a node
 *
 * @return the node inserted
**/
  public BTNode insert(BTNode v);

/*********************************************************************
 * Method to return a boolean as to whether the tree is empty.
 *
 * @return the <code>boolean</code> answer.
**/
  public boolean isEmpty();

/*********************************************************************
 * Method to return a boolean as to whether the node is the root.
 *
 * @return the <code>boolean</code> answer.
**/
  public boolean isRoot(BTNode v);

/*********************************************************************
 * Method to convert the tree to a <code>String</code> in inorder.
 *
 * @return the inorder <code>String</code> version of the tree.
**/
  public String toStringInorder(BTNode v);

/*********************************************************************
 * Method to convert the tree to a <code>String</code> in preorder.
 *
 * @return the preorder <code>String</code> version of the tree.
**/
//  public String toStringPreorder(BTNode v);

/*********************************************************************
 * Method to convert the tree to a <code>String</code> in postorder.
 *
 * @return the postorder <code>String</code> version of the tree.
**/
//  public String toStringPostorder(BTNode v);

} // public interface IBT
